using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using BA.DAL;
using Microsoft.VisualBasic;

namespace BlazeApps.Library.Forum
{
    public class BoardList : Base
    {
        public enum BoardListType
        {
            adminlist = 0,
            publiclist = 1
        }

        private BA.DAL.DBUtility DAL = new BA.DAL.DBUtility();
        private Procedures Procs = new Procedures();

        public DataTable GetBoards(BoardListType ListType)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@ListType", ListType);

            return DAL.GetDataTable(Procs.ListBoards.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetBoardSelectionList()
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            return DAL.GetDataTable(Procs.ForumBoardSelectionList.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetBreadCrumbLinks(Guid BoardID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@BoardID", BoardID);

            return DAL.GetDataTable(Procs.ListLinkDataForBoardByBoardID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }        
    }
}
